package cn.hejx.controller;

import cn.hejx.remoteapi.IMessage;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created by 追风少年
 *
 * @email doubihah@foxmail.com
 * @create 2017-07-03 18:19
 **/
@Controller
public class MessageController {

    @Resource
    private IMessage message;

    @RequestMapping("/index")
    public String index(){
        return "index";
    }

    @ResponseBody
    @RequestMapping(value = "/echo" ,method = RequestMethod.GET)
    public String echo(@RequestParam("msg") String msg){
        return message.echo(msg);
    }

}
